from channels.channels import Channel

class Lines2Space(Channel):
    """Convert lines to lines for space split"""
    required = ['lines']
    send = ['processed_lines']
    
    @staticmethod
    def execute(args={}, meta={}, lines=[], **kwargs):
        new_lines = []
        for index, line in enumerate(lines):
            
            # bar show
            args.bar_show(index, len(lines))

            line = ' '.join(line)
            new_lines.append(line)
        
        return {
            'args': args,
            'meta': meta, 
            'lines': new_lines
        }